table.MEMO_CHECK Function

Syntax

Result as C = Memo_Check(C options[,L Repair])

Arguments

Result

Information about problem memos.

options

Method options:

"P" = show progress on status bar during a repair operation
"V" = validate the memo file (headers for memos + the free list)
"F" = Show memo allocations and free space in the memo file.
"FS" = Show memo allocations and free space in the memo file and display up to 64 ASCII characters of each memo.
"R= Number " = Start at record Number. A negative record Number means start at Number characters before the end of the memo.
Repair

Logical

Description

Validate the structure of a memo file flags (v-alidate,f-ilemapping,fs-file mapping with sample,r=# - start at record).

Discussion

The <TBL>.MEMO_CHECK() method checks the integrity of memo fields and repairs them.

Example

dim result as C
dim fn as P
result = t.memo_check("v")
If (result <> "") then
    t.memo_check("P", .t.)
    fn = t.filename_get()
    fn = stritran(fn, ".dbf", ".memo_errors")
end if
t = table.open("orderhistory")
t.memo_check("V")
t.close()
t = table.open("customer")
? t.memo_check("fs")
= ""

The following example will check the last ten records entered in the memo file. This only helps if you are debugging an application where only recently new memos are being edited.

t.memo_check("vR=-10")

The following example shows a sample of the type of problem description you can retrieve.

t = table.open("g:\orderhistory_backup\edlar.dbf")
? t.memo_check("vp",.f.)
= Record 2944 original blocks 0 is less than blocks consumed 1
Record 2998 block count of 28606910 (and original blocks 543584879) is invalid
Record 3002 block count of 29986182 (and original blocks 891318389) is invalid
Record 3002 crosslinked - truncates data in 2998
Record 3013 crosslinked - truncates data in 3002
Record 3024 crosslinked - truncates data in 3002
Record 3035 crosslinked - duplicates data in 3002
Record 3036 crosslinked - truncates data in 3002
Record 3038 block count of 8425673 (and original blocks 1701995876) is invalid
Record 3038 crosslinked - truncates data in 3036
Record 3038 crosslinked - duplicates data in 3002
Record 3044 crosslinked - truncates data in 3038

See Also